package com.wdemo.controller;

import com.wdemo.pojo.vo.MessageVo;
import com.wdemo.pojo.vo.SessionVO;
import com.wdemo.service.ChatHistoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName ChatHistoryController
 * @Description 历史会话控制器
 * @Author WDEMO
 * @Date 2025/8/20 20:57
 */

@CrossOrigin
@RestController
@RequestMapping("/ai/history")
@RequiredArgsConstructor
public class ChatHistoryController {


    private final ChatHistoryService chatHistoryService;


    @GetMapping("/{type}")
    public List<SessionVO> getHistoryChatIds(@PathVariable("type") String type){
        return chatHistoryService.getHistoryChatIds(type);
    }

    @RequestMapping("/{type}/{chatId}")
    public List<MessageVo> getHistoryContest(@PathVariable("type") String type, @PathVariable("chatId") String chatId){
        return chatHistoryService.getHistoryContest(type, chatId);
    }
}
